#include "common/defines.h"
#include "makeaccountrequest.h"
#include "makeaccountresponse.h"
#include "network/networkjsonresponse.h"
#include <json.h>
#include <QDebug>
#include <QUrl>

MakeAccountRequest::MakeAccountRequest(const QString &phone,
                                       const QString &code)
    :m_response(new MakeAccountResponse()),
     m_phone(phone),
     m_code(code)
{
}


MakeAccountRequest::~MakeAccountRequest()
{
    delete m_response;
    m_response = NULL;
}


QUrl MakeAccountRequest::url() const
{
    QString url = QString(REST_CREATE_NEW_ACCOUNT_BY_PHONE).arg(m_phone, m_code);
    //qDebug() << "Login Request Url:";
    //qDebug() << url;
    return QUrl(url);
}


Network::JSONResponse &MakeAccountRequest::jsonResponse()
{
    return *m_response;
}


const Network::JSONResponse &MakeAccountRequest::jsonResponse() const
{
    return *m_response;
}

